import numpy as np

# 模拟一个简单的神经网络层
input_size = 3
hidden_size = 4
batch_size = 2

# 随机生成输入数据和权重矩阵
X = np.random.randn(batch_size, input_size)  # 输入矩阵
W = np.random.randn(input_size, hidden_size)  # 权重矩阵
b = np.random.randn(hidden_size)  # 偏置向量

# 前向传播计算
Z = np.dot(X, W) + b  # 线性变换
print("输入形状:", X.shape)
print("权重形状:", W.shape)
print("输出形状:", Z.shape)